package com.mxsat.system.dao.impl;

import java.util.Map;

import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mxsat.common.dao.DaoImpl;
import com.mxsat.system.dao.SysRoleDao;
import com.mxsat.system.entity.SysRole;

@Repository
public class SysRoleDaoImpl extends DaoImpl<BaseMapper<SysRole>, SysRole> implements SysRoleDao {

	@Override
	public IPage<SysRole> selectRoleByPage(IPage<SysRole> page, Map<String, Object> condition) throws Exception {
		QueryWrapper<SysRole> queryWrapper = new QueryWrapper<>();
		if(!StringUtils.isEmpty(condition.get("keyword"))) {
			queryWrapper.like("name", condition.get("keyword"));
		}
		return this.page(page, queryWrapper);
	}

	 

}
